package com.extension.company.view.adapter;

import android.content.Context;
import android.graphics.Color;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.extension.company.admin.R;
import com.extension.company.model.entity.AreaData;

import java.util.List;

public class PwAddressListAddAdapter extends BaseRecyclerAdapter<AreaData, PwAddressListAddAdapter.Holder> {

    public PwAddressListAddAdapter(Context context, List<AreaData> list) {
        super(context, list);
    }

    @Override
    public Holder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.pwaddresslistadd_item, parent, false);
        Holder holder = new Holder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) {
        super.onBindViewHolder(viewHolder, position);
        Holder holder = (Holder) viewHolder;
        holder.tv_content.setText(list.get(position).getName());
    }

    class Holder extends RecyclerView.ViewHolder {
        private TextView tv_content;
        public Holder(@NonNull View itemView) {
            super(itemView);
            tv_content = itemView.findViewById(R.id.tv_content);
        }
    }
}
